/**
 * Copyright 2011 Joe Choi, All rights reserved.
 */
package tao.data.structure.tree;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * The implementation of Trees interface
 * 
 * @author Joe Choi
 */
public class ConcreteTrees<V> extends AbstractTrees<V> {
	public ConcreteTrees() {
		this(new ArrayList<Tree<V>>());
	}
	
	public ConcreteTrees(Trees<V> trees) {
		this(trees != null ? trees.generalize() : new ArrayList<Tree<V>>());
	}
		
	public ConcreteTrees(Tree<V>[] trees) {
		this(trees != null ? Arrays.asList(trees) : new ArrayList<Tree<V>>());
	}
	
	public ConcreteTrees(List<Tree<V>> treeList) {
		trees = new ArrayList<Tree<V>>();
		if(treeList != null) trees.addAll(treeList);
	}

	@Override
	protected List<Tree<V>> getTrees() {
		return(trees);
	}
	
	private ArrayList<Tree<V>> trees;
}
